package org.pkw.pkwpicbackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.pkw.pkwpicbackend.model.dto.picture.PictureQueryRequest;
import org.pkw.pkwpicbackend.model.dto.picture.PictureUploadRequest;
import org.pkw.pkwpicbackend.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import org.pkw.pkwpicbackend.model.entity.User;
import org.pkw.pkwpicbackend.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
* @author 潘凯闻
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-04-27 18:42:24
*/
public interface PictureService extends IService<Picture> {
    /**
     * 上传图片
     *
     * @param multipartFile
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(MultipartFile multipartFile,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    /**
     * 用于将查询请求转为 QueryWrapper 对象
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    void validPicture(Picture picture);
}
